home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / MATH / MATLAB.ZIP / HELP < prev    next >
Text File  |  1986-02-06  |  34KB  |  757 lines

  1. HELP is available
  2.  
  3. NEWS  MATLAB NEWS dated 9/15/83.
  4.       HELP is now a lot faster.
  5.  
  6. INTRO Welcome to MATLAB.
  7.  
  8.       Here are a few sample statements:
  9.  
  10.       A = <1 2; 3 4>
  11.       b = <5 6>'
  12.       x = A\b
  13.       <V,D> = eig(A),  norm(A-V*D/V)
  14.       help \ , help eig
  15.       exec('demo',7)
  16.  
  17.       For more information, see the MATLAB Users' Guide which  is
  18.       contained in file ...  or may be obtained from ... .
  19.  
  20. <     < > Brackets used in forming vectors and matrices.
  21.       <6.9  9.64  SQRT(-1)>  is  a  vector  with  three  elements
  22.       separated  by  blanks.   <6.9,  9.64, sqrt(-1)> is the same
  23.       thing.  <1+I 2-I 3>  and  <1 +I 2 -I 3>  are not the  same.
  24.       The first has three elements, the second has five.
  25.       <11 12 13; 21 22 23>  is a 2 by 3 matrix .   The  semicolon
  26.       ends the first row.
  27.  
  28.       Vectors and matrices can be used inside < > brackets.
  29.       <A B; C>  is allowed if the number of rows  of   A   equals
  30.       the  number  of rows of  B  and the number of columns of  A
  31.       plus the number of columns of   B   equals  the  number  of
  32.       columns  of   C  .   This  rule  generalizes in a hopefully
  33.       obvious way to allow fairly complicated constructions.
  34.  
  35.       A = < >  stores an empty matrix in  A , thereby removing it
  36.       from the list of current variables.
  37.  
  38.       For the use of < and > on the left of  the  =  in  multiple
  39.       assignment statements, see LU, EIG, SVD and so on.
  40.  
  41.       In WHILE and IF clauses, <>  means  less  than  or  greater
  42.       than,  i.e.  not  equal, < means less than, > means greater
  43.       than, <= means less than or equal, >= means greater than or
  44.       equal.
  45.  
  46.       For the use of > and < to delineate macros, see MACRO.
  47.  
  48. >     See < .  Also see MACRO.
  49.  
  50. (     ( ) Used to indicate precedence in  arithmetic  expressions
  51.       in  the  usual way.  Used to enclose arguments of functions
  52.       in the usual way.  Used to enclose  subscripts  of  vectors
  53.       and  matrices  in  a  manner somewhat more general than the
  54.       usual way.  If  X   and   V  are  vectors,  then   X(V)  is
  55.       <X(V(1)),  X(V(2)),  ...,  X(V(N))> .  The components of  V
  56.       are rounded to nearest integers and used as subscripts.  An
  57.       error  occurs  if  any  such  subscript  is  less than 1 or
  58.       greater than the dimension of  X .  Some examples:
  59.       X(3)  is the third element of  X .
  60.       X(<1 2 3>)  is the first three elements of  X .  So is
  61.       X(<SQRT(2), SQRT(3), 4*ATAN(1)>)  .
  62.       If  X  has  N  components,  X(N:-1:1) reverses them.
  63.       The same indirect subscripting is used in matrices.  If   V
  64.       has   M  components and  W  has  N  components, then A(V,W)
  65.       is the  M by N  matrix formed from the elements of A  whose
  66.       subscripts are the elements of  V  and  W .  For example...
  67.       A(<1,5>,:) = A(<5,1>,:)  interchanges rows 1 and 5 of  A .
  68.  
  69. )     See  ( .
  70.  
  71. =     Used in assignment statements and to mean equality in WHILE
  72.       and IF clauses.
  73.  
  74. .     Decimal point.  314/100, 3.14  and   .314E1   are  all  the
  75.       same.
  76.  
  77.       Element-by-element multiplicative operations  are  obtained
  78.       using  .*  ,  ./  , or .\ .  For example, C = A ./ B is the
  79.       matrix with elements  c(i,j) = a(i,j)/b(i,j) .
  80.  
  81.       Kronecker tensor products and quotients are  obtained  with
  82.       .*. , ./.  and .\. .  See KRON.
  83.  
  84.       Two or  more  points  at  the  end  of  the  line  indicate
  85.       continuation.    The   total  line  length  limit  is  1024
  86.       characters.
  87.  
  88. ,     Used to separate matrix subscripts and function  arguments.
  89.       Used  at  the  end  of  FOR, WHILE and IF clauses.  Used to
  90.       separate statements  in  multi-statement  lines.   In  this
  91.       situation,  it  may  be  replaced  by semicolon to suppress
  92.       printing.
  93.  
  94. ;     Used inside brackets to end rows.
  95.       Used after an expression or statement to suppress printing.
  96.       See SEMI.
  97.  
  98. \     Backslash or matrix left division.   A\B   is  roughly  the
  99.       same  as   INV(A)*B  , except it is computed in a different
  100.       way.  If  A  is an N by N matrix and  B  is a column vector
  101.       with  N  components, or a matrix with several such columns,
  102.       then X = A\B  is the solution to  the  equation   A*X  =  B
  103.       computed  by  Gaussian  elimination.   A warning message is
  104.       printed if  A is badly scaled or nearly singular.
  105.       A\EYE produces the inverse of  A .
  106.  
  107.       If  A  is an  M by N  matrix with  M < or > N  and  B  is a
  108.       column vector with  M  components, or a matrix with several
  109.       such columns, then  X = A\B  is the solution in  the  least
  110.       squares  sense  to  the under- or overdetermined system  of
  111.       equations A*X = B .  The  effective  rank,  K,  of   A   is
  112.       determined  from  the  QR  decomposition  with pivoting.  A
  113.       solution  X  is  computed  which  has  at  most  K  nonzero
  114.       components  per column.  If  K < N this will usually not be
  115.       the same solution as PINV(A)*B .
  116.       A\EYE produces a generalized inverse of  A .
  117.  
  118.       If A and B have the  same  dimensions,  then  A  .\  B  has
  119.       elements a(i,j)\b(i,j) .
  120.  
  121.       Also, see EDIT.
  122.  
  123. /     Slash or matrix right division.  B/A  is roughly  the  same
  124.       as  B*INV(A) .  More precisely,  B/A = (A'\B')' .  See \ .
  125.  
  126.       IF A and B have the  same  dimensions,  then  A  ./  B  has
  127.       elements a(i,j)/b(i,j) .
  128.  
  129.       Two or more slashes together on a line indicate  a  logical
  130.       end of line.  Any following text is ignored.
  131.  
  132. '     Transpose.  X'  is the complex conjugate transpose of  X  .
  133.       Quote.   'ANY  TEXT'   is a vector whose components are the
  134.       MATLAB internal codes for the characters.  A  quote  within
  135.       the text is indicated by two quotes.  See DISP and FILE .
  136.  
  137. +     Addition.  X + Y .  X and Y must have the same dimensions.
  138.  
  139. -     Subtraction.  X  -  Y  .   X  and  Y  must  have  the  same
  140.       dimensions.
  141.  
  142. *     Matrix multiplication, X*Y .  Any scalar (1  by  1  matrix)
  143.       may multiply anything.  Otherwise, the number of columns of
  144.       X must equal the number of rows of Y .
  145.  
  146.       Element-by-element multiplication is obtained with X .* Y .
  147.  
  148.       The Kronecker tensor product is denoted by X .*. Y .
  149.  
  150.       Powers.  X**p  is  X  to the   p   power.   p   must  be  a
  151.       scalar.  If  X  is a matrix, see  FUN .
  152.  
  153. :     Colon.  Used in subscripts,  FOR  iterations  and  possibly
  154.       elsewhere.
  155.       J:K  is the same as  <J, J+1, ..., K>
  156.       J:K  is empty if  J > K .
  157.       J:I:K  is the same as  <J, J+I, J+2I, ..., K>
  158.       J:I:K  is empty if  I > 0 and J > K or if I < 0 and J < K .
  159.       The colon notation can be used to pick out  selected  rows,
  160.       columns and elements of vectors and matrices.
  161.       A(:)  is all the  elements  of  A,  regarded  as  a  single
  162.       column.
  163.       A(:,J)  is the  J-th  column of A
  164.       A(J:K)  is  A(J),A(J+1),...,A(K)
  165.       A(:,J:K)  is  A(:,J),A(:,J+1),...,A(:,K) and so on.
  166.       For the use of the colon in the FOR statement, See FOR .
  167.  
  168. ABS   ABS(X)  is the absolute value, or complex modulus,  of  the
  169.       elements of X .
  170.  
  171. ANS   Variable created automatically  when  expressions  are  not
  172.       assigned to anything else.
  173.  
  174. ATAN  ATAN(X)  is the arctangent of  X .  See FUN .
  175.  
  176. BASE  BASE(X,B) is a vector containing the base B  representation
  177.       of   X  .   This is often used in conjunction with DISPLAY.
  178.       DISPLAY(X,B)  is  the  same  as  DISPLAY(BASE(X,B)).    For
  179.       example,    DISP(4*ATAN(1),16)   prints   the   hexadecimal
  180.       representation of pi.
  181.  
  182. CHAR  CHAR(K)  requests  an  input  line  containing   a   single
  183.       character  to  replace  MATLAB  character  number  K in the
  184.       following table.  For example, CHAR(45) replaces backslash.
  185.       CHAR(-K) replaces the alternate character number K.
  186.  
  187.                 K  character alternate name
  188.               0 - 9   0 - 9    0 - 9   digits
  189.              10 - 35  A - Z    a - z   letters
  190.                36                      blank
  191.                37       (        (     lparen
  192.                38       )        )     rparen
  193.                39       ;        ;     semi
  194.                40       :        |     colon
  195.                41       +        +     plus
  196.                42       -        -     minus
  197.                43       *        *     star
  198.                44       /        /     slash
  199.                45       \        $     backslash
  200.                46       =        =     equal
  201.                47       .        .     dot
  202.                48       ,        ,     comma
  203.                49       '        "     quote
  204.                50       <        [     less
  205.                51       >        ]     great
  206.  
  207. CHOL  Cholesky factorization.  CHOL(X)  uses  only  the  diagonal
  208.       and upper triangle of  X .  The lower triangular is assumed
  209.       to be the (complex conjugate) transpose of the  upper.   If
  210.       X   is  positive  definite,  then  R = CHOL(X)  produces an
  211.       upper triangular  R  so that  R'*R = X .   If   X   is  not
  212.       positive definite, an error message is printed.
  213.  
  214. CHOP  Truncate arithmetic.  Floating-point  numbers  have  53 bit
  215.       mantissas whose leading bit is not stored since the numbers
  216.       are normalized.  CHOP(P)  truncates the last  4*P  bits  of
  217.       each floating-point number for 0 < P < 13  (any other value
  218.       of P causes full precision to be used.)    CHOP(0) restores
  219.       full precision.
  220.  
  221. CLEAR Erases all variables, except EPS, FLOP, EYE and RAND.
  222.       X = <>  erases only variable  X .  So does CLEAR X .
  223.  
  224. COND  Condition number in 2-norm.  COND(X) is the  ratio  of  the
  225.       largest singular value of  X  to the smallest.
  226.  
  227. CONJG CONJG(X)  is the complex conjugate of  X .
  228.  
  229. COS   COS(X)  is the cosine of  X .  See FUN .
  230.  
  231. DET   DET(X)  is the determinant of the square matrix  X .
  232.  
  233. DIAG  If  V  is  a  row  or  column  vector  with  N  components,
  234.       DIAG(V,K)   is a square matrix of order  N+ABS(K)  with the
  235.       elements of  V  on the K-th diagonal.  K = 0  is  the  main
  236.       diagonal,  K  >  0  is above the main diagonal and K < 0 is
  237.       below the main diagonal.  DIAG(V)  simply puts  V   on  the
  238.       main diagonal.
  239.       eg. DIAG(-M:M) + DIAG(ONES(2*M,1),1) + DIAG(ONES(2*M,1),-1)
  240.       produces a tridiagonal matrix of order 2*M+1 .
  241.       IF  X  is a matrix,  DIAG(X,K)  is a column  vector  formed
  242.       from the elements of the K-th diagonal of  X .
  243.       DIAG(X)  is the main diagonal of  X .
  244.       DIAG(DIAG(X))  is a diagonal matrix .
  245.  
  246. DIARY DIARY('file') causes a  copy  of  all  subsequent  terminal
  247.       input and most of the resulting output to be written on the
  248.       file. DIARY(0) turns it off.  See FILE.
  249.  
  250. DISP  DISPLAY(X) prints X  in  a  compact  format.   If  all  the
  251.       elements  of  X  are  integers  between 0 and 51, then X is
  252.       interpreted  as  MATLAB  text  and   printed   accordingly.
  253.       Otherwise,  +  ,  -   and  blank  are printed for positive,
  254.       negative and zero elements.  Imaginary parts are ignored.
  255.       DISP(X,B) is the same as DISP(BASE(X,B)).
  256.  
  257. EDIT  There  are  no   editing   features   available   on   most
  258.       installations and EDIT is not a command.  However, on a few
  259.       systems a command line consisting of a single  backslash  \
  260.       will  cause  the local file editor to be called with a copy
  261.       of the  previous  input  line.   When  the  editor  returns
  262.       control to MATLAB, it will execute the line again.
  263.  
  264. EIG   Eigenvalues and eigenvectors.
  265.       EIG(X) is a vector containing the eigenvalues of  a  square
  266.       matrix  X .
  267.       <V,D>  =  EIG(X)   produces  a  diagonal  matrix    D    of
  268.       eigenvalues  and  a  full  matrix  V  whose columns are the
  269.       corresponding eigenvectors so that  X*V = V*D .
  270.  
  271. ELSE  Used with IF .
  272.  
  273. END   Terminates the scope  of  FOR,  WHILE  and  IF  statements.
  274.       Without  END's,  FOR  and WHILE repeat all statements up to
  275.       the end of the line.  Each END is paired with  the  closest
  276.       previous  unpaired FOR or WHILE and serves to terminate its
  277.       scope.  The line
  278.       FOR I=1:N, FOR J=1:N, A(I,J)=1/(I+J-1); A
  279.       would cause A to be printed  N**2  times, once for each new
  280.       element.  On the other hand, the line
  281.       FOR I=1:N, FOR J=1:N, A(I,J)=1/(I+J-1); END, END, A
  282.       will lead to only the final printing of  A .
  283.       Similar considerations apply to WHILE.
  284.       EXIT terminates execution of loops or of MATLAB itself.
  285.  
  286. EPS   Floating point relative  accuracy.   A  permanent  variable
  287.       whose  value is initially the distance from 1.0 to the next
  288.       largest floating point number.  The  value  is  changed  by
  289.       CHOP,  and  other values may be assigned.  EPS is used as a
  290.       default tolerance by PINV and RANK.
  291.  
  292. EXEC  EXEC('file',k) obtains  subsequent  MATLAB  input  from  an
  293.       external  file.  The printing of input is controlled by the
  294.       optional parameter k .
  295.       If k = 1 , the input is echoed.
  296.       If k = 2 , the MATLAB prompt <> is printed.
  297.       If k = 4 , MATLAB pauses before each prompt and waits for a
  298.       null line to continue.
  299.       If k = 0 , there is no echo, prompt or pause.  This is  the
  300.       default if the exec command is followed by a semicolon.
  301.       If k = 7 , there will be echos, prompts and pauses. This is
  302.       useful for demonstrations on video terminals.
  303.       If k = 3 , there will be echos and prompts, but no  pauses.
  304.       This is the the default if the exec command is not followed
  305.       by a semicolon.
  306.       EXEC(0) causes subsequent input to  be  obtained  from  the
  307.       terminal. An end-of-file has the same effect.
  308.       EXEC's may be nested, i.e. the text in the file may contain
  309.       EXEC of another file.  EXEC's may also be driven by FOR and
  310.       WHILE loops.
  311.  
  312. EXIT  Causes termination of a FOR or WHILE loop.
  313.       If not in a loop, terminates execution of MATLAB.
  314.  
  315. EXP   EXP(X)  is the exponential of  X ,  e  to the X .  See  FUN
  316.       .
  317.  
  318. EYE   Identity matrix.  EYE(N) is the N  by  N  identity  matrix.
  319.       EYE(M,N)   is an M by N matrix with 1's on the diagonal and
  320.       zeros elsewhere.  EYE(A)  is the same size  as   A  .   EYE
  321.       with  no  arguments is an identity matrix of whatever order
  322.       is appropriate in the context.   For  example,  A  +  3*EYE
  323.       adds  3  to each diagonal element of  A .
  324.  
  325. FILE  The EXEC, SAVE, LOAD,  PRINT  and  DIARY  functions  access
  326.       files.   The  'file'  parameter  takes  different forms for
  327.       different operating systems.  On most systems,  'file'  may
  328.       be a string of up to 32 characters in quotes.  For example,
  329.       SAVE('A') or EXEC('matlab/demo.exec') .  The string will be
  330.       used as the name of a file in the local operating system.
  331.       On all systems, 'file' may be a positive integer   k   less
  332.       than  10  which  will  be  used  as  a FORTRAN logical unit
  333.       number. Some systems then automatically access a file  with
  334.       a  name  like  FORT.k  or FORk.DAT. Other systems require a
  335.       file with a name like FT0kF001 to be assigned  to  unit   k
  336.       before  MATLAB  is  executed. Check your local installation
  337.       for details.
  338.  
  339. FLOPS Count of floating point operations.
  340.       FLOPS  is  a  permanently  defined  row  vector  with   two
  341.       elements.    FLOPS(1)  is  the  number  of  floating  point
  342.       operations counted during the previous statement.  FLOPS(2)
  343.       is  a  cumulative total.  FLOPS can be used in the same way
  344.       as any other vector.  FLOPS(2) = 0  resets  the  cumulative
  345.       total.   In  addition,  FLOPS(1) will be printed whenever a
  346.       statement is terminated by an extra comma.  For example,
  347.       X = INV(A);,
  348.       or
  349.       COND(A),   (as the last statement on the line).
  350.       HELP FLPS gives more details.
  351.  
  352. FLPS  More detail on FLOPS.
  353.       It is not feasible to count absolutely all  floating  point
  354.       operations,  but  most  of  the important ones are counted.
  355.       Each multiply and add in a real vector operation such as  a
  356.       dot  product  or  a 'saxpy' counts one flop.  Each multiply
  357.       and add in a complex vector  operation  counts  two  flops.
  358.       Other additions, subtractions and multiplications count one
  359.       flop each if the result is real and two flops if it is not.
  360.       Real  divisions  count one and complex divisions count two.
  361.       Elementary functions count one if real and two if  complex.
  362.       Some examples.  If A and B are real N by N matrices, then
  363.       A + B  counts N**2 flops,
  364.       A*B    counts N**3 flops,
  365.       A**100 counts 99*N**3 flops,
  366.       LU(A)  counts roughly (1/3)*N**3 flops.
  367.  
  368. FOR   Repeat statements a specific number of times.
  369.       FOR variable = expr, statement, ..., statement, END
  370.       The END at the end of a line may  be  omitted.   The  comma
  371.       before  the  END  may  also be omitted.  The columns of the
  372.       expression are stored one at a time  in  the  variable  and
  373.       then the following statements, up to the END, are executed.
  374.       The expression is often of the form X:Y, in which case  its
  375.       columns  are  simply  scalars.  Some examples (assume N has
  376.       already been assigned a value).
  377.       FOR I = 1:N, FOR J = 1:N, A(I,J) = 1/(I+J-1);
  378.       FOR J = 2:N-1, A(J,J) = J; END; A
  379.       FOR S = 1.0: -0.1: 0.0, ...  steps S with increments of -0.1 .
  380.       FOR E = EYE(N), ...   sets  E  to the unit N-vectors.
  381.       FOR V = A, ...   has the same effect as
  382.       FOR J = 1:N, V = A(:,J); ...  except J is also set here.
  383.  
  384. FUN   For matrix arguments  X , the  functions  SIN,  COS,  ATAN,
  385.       SQRT,  LOG,  EXP and X**p are computed using eigenvalues  D
  386.       and eigenvectors  V .  If  <V,D> =  EIG(X)   then   f(X)  =
  387.       V*f(D)/V  .   This method may give inaccurate results if  V
  388.       is badly conditioned.  Some idea of  the  accuracy  can  be
  389.       obtained by comparing  X**1  with  X .
  390.       For vector arguments,  the  function  is  applied  to  each
  391.       component.
  392.  
  393. HESS  Hessenberg form.  The Hessenberg form of a matrix  is  zero
  394.       below the first subdiagonal.  If the matrix is symmetric or
  395.       Hermitian,  the  form  is  tridiagonal.   <P,H>  =  HESS(A)
  396.       produces  a  unitary  matrix P and a Hessenberg matrix H so
  397.       that A = P*H*P'.  By itself, HESS(A) returns H.
  398.  
  399. HILB  Inverse Hilbert matrix.  HILB(N)  is the inverse of  the  N
  400.       by  N   matrix  with elements  1/(i+j-1), which is a famous
  401.       example of a badly conditioned matrix.  The result is exact
  402.       for  N  less than about 15, depending upon the computer.
  403.  
  404. IF    Conditionally execute statements.  Simple form...
  405.       IF expression rop expression, statements
  406.       where rop is =, <, >, <=, >=, or  <>  (not  equal)  .   The
  407.       statements  are  executed  once if the indicated comparison
  408.       between the real parts of the first components of  the  two
  409.       expressions  is true, otherwise the statements are skipped.
  410.       Example.
  411.       IF ABS(I-J) = 1, A(I,J) = -1;
  412.       More complicated forms use END in the same way it  is  used
  413.       with FOR and WHILE and use ELSE as an abbreviation for END,
  414.       IF expression not rop expression .  Example
  415.       FOR I = 1:N, FOR J = 1:N, ...
  416.          IF I = J, A(I,J) = 2; ELSE IF ABS(I-J) = 1, A(I,J) = -1; ...
  417.          ELSE A(I,J) = 0;
  418.       An easier way to accomplish the same thing is
  419.       A = 2*EYE(N);
  420.       FOR I = 1:N-1, A(I,I+1) = -1; A(I+1,I) = -1;
  421.  
  422. IMAG  IMAG(X)  is the imaginary part of  X .
  423.  
  424. INV   INV(X)  is the inverse of the square matrix  X .  A warning
  425.       message  is  printed  if   X   is  badly  scaled  or nearly
  426.       singular.
  427.  
  428. KRON  KRON(X,Y) is the Kronecker tensor product of X and Y  .  It
  429.       is  also  denoted by X .*. Y . The result is a large matrix
  430.       formed by taking all possible products between the elements
  431.       of  X  and  those  of Y . For example, if X is 2 by 3, then
  432.       X .*. Y is
  433.  
  434.             < x(1,1)*Y  x(1,2)*Y  x(1,3)*Y
  435.               x(2,1)*Y  x(2,2)*Y  x(2,3)*Y >
  436.  
  437.       The five-point discrete Laplacian for an n-by-n grid can be
  438.       generated by
  439.  
  440.             T = diag(ones(n-1,1),1);  T = T + T';  I = EYE(T);
  441.             A = T.*.I + I.*.T - 4*EYE;
  442.  
  443.       Just  in  case  they  might  be  useful,  MATLAB   includes
  444.       constructions called Kronecker tensor quotients, denoted by
  445.       X ./. Y and X .\. Y .  They are obtained by  replacing  the
  446.       elementwise multiplications in X .*. Y with divisions.
  447.  
  448. LINES An internal count is kept of the number of lines of  output
  449.       since  the  last  input.   Whenever this count approaches a
  450.       limit, the  user  is  asked  whether  or  not  to  suppress
  451.       printing  until the next input.  Initially the limit is 25.
  452.       LINES(N) resets the limit to N .
  453.  
  454. LOAD  LOAD('file') retrieves all the variables from  the  file  .
  455.       See  FILE  and  SAVE for more details.  To prepare your own
  456.       file for LOADing, change the READs to WRITEs  in  the  code
  457.       given under SAVE.
  458.  
  459. LOG   LOG(X)  is the  natural  logarithm  of   X  .   See  FUN  .
  460.       Complex results are produced if  X  is not positive, or has
  461.       nonpositive eigenvalues.
  462.  
  463. LONG  Determine output format.   All  computations  are  done  in
  464.       complex arithmetic and double precision if it is available.
  465.       SHORT and  LONG  merely  switch  between  different  output
  466.       formats.
  467.       SHORT    Scaled fixed point format with about 5 digits.
  468.       LONG     Scaled fixed point format with about 15 digits.
  469.       SHORT E  Floating point format with about 5 digits.
  470.       LONG E   Floating point format with about 15 digits.
  471.       LONG Z   System dependent format, often hexadecimal.
  472.  
  473. LU    Factors from Gaussian elimination.  <L,U> = LU(X)  stores a
  474.       upper triangular matrix in  U  and a 'psychologically lower
  475.       triangular matrix', i.e. a product of lower triangular  and
  476.       permutation matrices, in L , so that  X = L*U .  By itself,
  477.       LU(X) returns the output from CGEFA .
  478.  
  479. MACRO The macro facility involves text and inward pointing  angle
  480.       brackets.  If  STRING  is  the  source  text for any MATLAB
  481.       expression or statement, then
  482.             t = 'STRING';
  483.       encodes the text as a vector of integers  and  stores  that
  484.       vector in  t .  DISP(t) will print the text and
  485.             >t<
  486.       causes the text to be interpreted, either as a statement or
  487.       as a factor in an expression.  For example
  488.             t = '1/(i+j-1)';
  489.             disp(t)
  490.             for i = 1:n, for j = 1:n, a(i,j) = >t<;
  491.       generates the Hilbert matrix of order n.
  492.       Another example showing indexed text,
  493.             S = <'x = 3            '
  494.                  'y = 4            '
  495.                  'z = sqrt(x*x+y*y)'>
  496.             for k = 1:3, >S(k,:)<
  497.       It is necessary that the strings making up  the  "rows"  of
  498.       the "matrix"  S  have the same lengths.
  499.  
  500. MAGIC Magic square.  MAGIC(N) is an N  by  N  matrix  constructed
  501.       from  the integers 1 through N**2 with equal row and column
  502.       sums.
  503.  
  504. NORM  For matrices..
  505.       NORM(X)  is the largest singular value of  X .
  506.       NORM(X,1)  is the 1-norm of  X .
  507.       NORM(X,2)  is the same as NORM(X) .
  508.       NORM(X,'INF')  is the infinity norm of  X .
  509.       NORM(X,'FRO')  is the F-norm, i.e.  SQRT(SUM(DIAG(X'*X))) .
  510.       For vectors..
  511.       NORM(V,P) = (SUM(V(I)**P))**(1/P) .
  512.       NORM(V) = NORM(V,2) .
  513.       NORM(V,'INF') = MAX(ABS(V(I))) .
  514.  
  515. ONES  All ones.  ONES(N)  is an N by N matrix of ones.  ONES(M,N)
  516.       is an M by N matrix of ones .  ONES(A)  is the same size as
  517.       A  and all ones .
  518.  
  519. ORTH  Orthogonalization.   Q  =  ORTH(X)   is   a   matrix   with
  520.       orthonormal  columns,  i.e. Q'*Q = EYE, which span the same
  521.       space as the columns of  X .
  522.  
  523. PINV  Pseudoinverse.  X = PINV(A) produces a matrix   X   of  the
  524.       same  dimensions as  A' so that  A*X*A = A , X*A*X = X  and
  525.       AX  and  XA  are Hermitian .  The computation is  based  on
  526.       SVD(A)  and  any  singular values less than a tolerance are
  527.       treated   as    zero.     The    default    tolerance    is
  528.       NORM(SIZE(A),'inf')*NORM(A)*EPS.   This  tolerance  may  be
  529.       overridden with X = PINV(A,tol).  See RANK.
  530.  
  531. PLOT  PLOT(X,Y) produces a plot of  the  elements  of  Y  against
  532.       those  of X . PLOT(Y) is the same as PLOT(1:n,Y) where n is
  533.       the  number  of   elements   in   Y   .    PLOT(X,Y,P)   or
  534.       PLOT(X,Y,p1,...,pk)  passes the optional parameter vector P
  535.       or scalars p1 through pk to the plot routine.  The  default
  536.       plot  routine  is a crude printer-plot. It is hoped that an
  537.       interface to local graphics equipment can be provided.
  538.       An interesting example is
  539.             t = 0:50;
  540.             PLOT( t.*cos(t), t.*sin(t) )
  541.  
  542. POLY  Characteristic polynomial.
  543.       If  A  is an N by N matrix, POLY(A) is a column vector with
  544.       N+1   elements   which   are   the   coefficients   of  the
  545.       characteristic polynomial,  DET(lambda*EYE - A) .
  546.       If V is a vector, POLY(V) is a vector  whose  elements  are
  547.       the  coefficients  of  the  polynomial  whose roots are the
  548.       elements of V .  For vectors, ROOTS and  POLY  are  inverse
  549.       functions  of  each  other,  up  to  ordering, scaling, and
  550.       roundoff error.
  551.       ROOTS(POLY(1:20)) generates Wilkinson's famous example.
  552.  
  553. PRINT PRINT('file',X) prints X on  the  file  using  the  current
  554.       format determined by SHORT, LONG Z, etc.  See FILE.
  555.  
  556. PROD  PROD(X)  is the product of all the elements of  X .
  557.  
  558. QR    Orthogonal-triangular decomposition.
  559.       <Q,R> = QR(X)  produces an upper triangular  matrix   R  of
  560.       the  same dimension as  X  and a unitary matrix  Q  so that
  561.       X = Q*R .
  562.       <Q,R,E> = QR(X)  produces a  permutation  matrix   E  ,  an
  563.       upper  triangular  R  with decreasing diagonal elements and
  564.       a unitary  Q  so that  X*E = Q*R .
  565.       By itself, QR(X) returns the output of CQRDC .  TRIU(QR(X))
  566.       is R .
  567.  
  568. RAND  Random numbers and matrices.  RAND(N)  is an N by N  matrix
  569.       with  random  entries.  RAND(M,N)  is an M by N matrix with
  570.       random entries.  RAND(A)  is the same size as   A  .   RAND
  571.       with no arguments is a scalar whose value changes each time
  572.       it is referenced.
  573.       Ordinarily,  random numbers are  uniformly  distributed  in
  574.       the  interval  (0.0,1.0)  .   RAND('NORMAL')  switches to a
  575.       normal distribution  with  mean  0.0  and  variance  1.0  .
  576.       RAND('UNIFORM')  switches back to the uniform distribution.
  577.       RAND('SEED') returns the current value of the seed for  the
  578.       generator.    RAND('SEED',n)   sets   the   seed   to  n  .
  579.       RAND('SEED',0) resets the seed to 0, its value when  MATLAB
  580.       is first entered.
  581.  
  582. RANK  Rank.  K = RANK(X) is the number of singular values  of   X
  583.       that are larger than NORM(SIZE(X),'inf')*NORM(X)*EPS.
  584.       K = RANK(X,tol) is the number of singular values of  X that
  585.       are larger than tol .
  586.  
  587. RCOND RCOND(X)   is  an  estimate  for  the  reciprocal  of   the
  588.       condition  of   X   in  the  1-norm obtained by the LINPACK
  589.       condition estimator.  If  X  is well conditioned,  RCOND(X)
  590.       is  near  1.0  .   If  X  is badly conditioned, RCOND(X) is
  591.       near 0.0 .
  592.       <R, Z> = RCOND(A) sets  R  to RCOND(A) and also produces  a
  593.       vector  Z so that
  594.                  NORM(A*Z,1) = R*NORM(A,1)*NORM(Z,1)
  595.       So, if RCOND(A) is small, then  Z  is an  approximate  null
  596.       vector.
  597.  
  598. RAT   An experimental  function  which  attempts  to  remove  the
  599.       roundoff   error  from  results  that  should  be  "simple"
  600.       rational numbers.
  601.       RAT(X) approximates each  element  of   X  by  a  continued
  602.       fraction of the form
  603.  
  604.                 a/b = d1 + 1/(d2 + 1/(d3 + ... + 1/dk))
  605.  
  606.       with k <= len, integer di and abs(di) <= max .  The default
  607.       values of the parameters are len = 5 and max = 100.
  608.       RAT(len,max) changes the default values.  Increasing either
  609.       len or max increases the number of possible fractions.
  610.       <A,B> = RAT(X) produces integer matrices A and B so that
  611.  
  612.                 A ./ B  =  RAT(X)
  613.  
  614.       Some examples:
  615.  
  616.             long
  617.             T = hilb(6), X = inv(T)
  618.             <A,B> = rat(X)
  619.             H = A ./ B, S = inv(H)
  620.  
  621.             short e
  622.             d = 1:8,  e = ones(d),  A = abs(d'*e - e'*d)
  623.             X = inv(A)
  624.             rat(X)
  625.             display(ans)
  626.  
  627.  
  628. REAL  REAL(X)  is the real part of  X .
  629.  
  630. RETURN  From the terminal, causes return to the operating  system
  631.       or  other  program  which  invoked  MATLAB.  From inside an
  632.       EXEC, causes  return  to  the  invoking  EXEC,  or  to  the
  633.       terminal.
  634.  
  635. RREF  RREF(A) is the reduced row echelon form of the  rectangular
  636.       matrix.  RREF(A,B) is the same as RREF(<A,B>) .
  637.  
  638. ROOTS Find polynomial roots.  ROOTS(C)  computes the roots of the
  639.       polynomial  whose  coefficients  are  the  elements  of the
  640.       vector  C .  If  C  has  N+1  components, the polynomial is
  641.       C(1)*X**N + ... + C(N)*X + C(N+1) .  See POLY.
  642.  
  643. ROUND ROUND(X)  rounds  the  elements  of   X   to  the   nearest
  644.       integers.
  645.  
  646. SAVE  SAVE('file') stores all the current variables in a file.
  647.       SAVE('file',X) saves only X .  See FILE .
  648.       The variables may be retrieved later by LOAD('file') or  by
  649.       your  own program using the following code for each matrix.
  650.       The lines involving XIMAG may be eliminated  if  everything
  651.       is known to be real.
  652.  
  653.             attach lunit to 'file'
  654.             REAL or DOUBLE PRECISION XREAL(MMAX,NMAX)
  655.             REAL or DOUBLE PRECISION XIMAG(MMAX,NMAX)
  656.             READ(lunit,101) ID,M,N,IMG
  657.             DO 10 J = 1, N
  658.                READ(lunit,102) (XREAL(I,J), I=1,M)
  659.                IF (IMG .NE. 0) READ(lunit,102) (XIMAG(I,J),I=1,M)
  660.          10 CONTINUE
  661.  
  662.       The formats used are system dependent.  The  following  are
  663.       typical.     See    SUBROUTINE   SAVLOD   in   your   local
  664.       implementation of MATLAB.
  665.  
  666.         101 FORMAT(4A1,3I4)
  667.         102 FORMAT(4Z18)
  668.         102 FORMAT(4O20)
  669.         102 FORMAT(4D25.18)
  670.  
  671. SCHUR Schur decomposition.  <U,T> = SCHUR(X)  produces  an  upper
  672.       triangular  matrix   T , with the eigenvalues of  X  on the
  673.       diagonal, and a unitary matrix  U so that  X =  U*T*U'  and
  674.       U'*U = EYE .  By itself, SCHUR(X) returns  T .
  675.  
  676. SHORT See LONG .
  677.  
  678. SEMI  Semicolons at the end of  lines  will  cause,  rather  than
  679.       suppress,  printing.   A  second  SEMI restores the initial
  680.       interpretation.
  681.  
  682. SIN   SIN(X)  is the sine of  X .  See FUN .
  683.  
  684. SIZE  If X is an M by N matrix, then SIZE(X) is <M, N> .
  685.       Can also be used with a multiple assignment,
  686.             <M, N> = SIZE(X) .
  687.  
  688. SQRT  SQRT(X)  is the square root of  X .   See  FUN  .   Complex
  689.       results  are  produced  if   X   is  not  positive,  or has
  690.       nonpositive eigenvalues.
  691.  
  692. STOP  Use EXIT instead.
  693.  
  694. SUM   SUM(X)   is  the  sum  of  all  the  elements   of    X   .
  695.       SUM(DIAG(X))  is the trace of  X .
  696.  
  697. SVD   Singular value decomposition.  <U,S,V> = SVD(X)  produces a
  698.       diagonal  matrix  S , of the same dimension as  X  and with
  699.       nonnegative diagonal  elements  in  decreasing  order,  and
  700.       unitary matrices  U  and  V  so that  X = U*S*V' .
  701.       By itself, SVD(X) returns a vector containing the  singular
  702.       values.
  703.       <U,S,V>   =   SVD(X,0)   produces   the   "economy    size"
  704.       decomposition.   If  X  is m by n with m > n, then only the
  705.       first n columns of U are computed and S is n by n .
  706.  
  707. TRIL  Lower triangle.  TRIL(X) is the lower triangular part of X.
  708.       TRIL(X,K) is the elements on and below the K-th diagonal of
  709.       X.  K = 0 is the main diagonal, K > 0  is  above  the  main
  710.       diagonal and K < 0 is below the main diagonal.
  711.  
  712. TRIU  Upper triangle.  TRIU(X) is the upper triangular part of X.
  713.       TRIU(X,K) is the elements on and above the K-th diagonal of
  714.       X.  K = 0 is the main diagonal, K > 0  is  above  the  main
  715.       diagonal and K < 0 is below the main diagonal.
  716.  
  717. USER  Allows personal  Fortran  subroutines  to  be  linked  into
  718.       MATLAB .  The subroutine should have the heading
  719.  
  720.                SUBROUTINE USER(A,M,N,S,T)
  721.                REAL or DOUBLE PRECISION A(M,N),S,T
  722.  
  723.       The MATLAB statement  Y = USER(X,s,t)  results in a call to
  724.       the  subroutine with a copy of the matrix  X  stored in the
  725.       argument  A , its column and row dimensions in  M  and  N ,
  726.       and  the scalar parameters  s  and  t  stored in  S  and  T
  727.       . If  s and t  are omitted, they are set to  0.0  .   After
  728.       the  return,   A  is stored in  Y .  The dimensions  M  and
  729.       N  may be reset within the subroutine.  The statement  Y  =
  730.       USER(K)  results in a call with M = 1, N = 1  and  A(1,1) =
  731.       FLOAT(K) .  After the subroutine has been written, it  must
  732.       be compiled and linked to the MATLAB object code within the
  733.       local operating system.
  734.  
  735. WHAT  Lists commands and functions currently available.
  736.  
  737. WHILE Repeat statements an indefinite number of times.
  738.       WHILE expr rop expr, statement, ..., statement, END
  739.       where rop is =, <, >, <=, >=, or <> (not equal) .  The  END
  740.       at  the end of a line may be omitted.  The comma before the
  741.       END may also be omitted.  The commas  may  be  replaced  by
  742.       semicolons   to   avoid   printing.    The  statements  are
  743.       repeatedly executed as long  as  the  indicated  comparison
  744.       between  the  real parts of the first components of the two
  745.       expressions is true.   Example  (assume  a  matrix   A   is
  746.       already defined).
  747.       E = 0*A; F = E + EYE; N = 1;
  748.       WHILE NORM(E+F-E,1) > 0, E = E + F; F = A*F/N; N = N + 1;
  749.       E
  750.  
  751. WHO   Lists current variables.
  752.  
  753. WHY   Provides succinct answers to any questions.
  754.  
  755. EOF   End of help file.
  756.